import Layout from "@/layouts/layout-index.vue";
import {RouteRecordRaw} from "vue-router";

// 用户管理模块的路由配置
export default {
    path: '/user',
    // 所有路由的命名都必须是唯一的。如果为多条路由添加相同的命名，路由器只会保留最后那一条。
    name: 'User',   // 命名路由，优点 https://router.vuejs.org/zh/guide/essentials/named-routes.html
    component: Layout,
    meta: {
        order: 2,
        title: "用户管理",
        icon: 'UserFilled',
        // 只有经过身份验证的用户才能创建帖子
        requiresAuth: false,
    },
    children: [
        {
            path: '/user/info',
            name: 'Info',
            component: () => import('@/views/user/info.vue'),
            meta: {
                title: "个人中心",
            },
        },
        {
            path: '/user/account',
            name: 'Account',
            component: () => import('@/views/user/account.vue'),
            meta: {
                title: "账号管理",
            },
        },
        {
            path: '/user/role',
            name: 'Role',
            component: () => import('@/views/user/role.vue'),
            meta: {
                title: "角色管理",
            },
        },
    ],
} as RouteRecordRaw;
